//
//  YsNumberView.h
//  YSKitExample
//
//  Created by Kyson on 2017/6/16.
//  Copyright © 2017年 YangShen. All rights reserved.
//
// 加减视图

#import <UIKit/UIKit.h>

@class YSNumberView;
@protocol YSNumberViewDelegate <NSObject>
@optional
- (void)ys_numberView:(YSNumberView *)numberView number:(NSString *)number;
@end

IB_DESIGNABLE
@interface YSNumberView : UIView

+ (instancetype)numberViewWithFrame:(CGRect)frame;

/// 加减按钮的回调
@property (nonatomic, copy) void(^numberBlock)(NSString *number);

/// 代理
@property (nonatomic, weak) id<YSNumberViewDelegate>delegate;

#pragma mark - 自定义样式
/// 是否开启抖动动画，默认NO
@property (nonatomic, assign) IBInspectable BOOL shakeAnimation;

/// 最小值时是否隐藏减按钮，默认NO
@property (nonatomic, assign) IBInspectable BOOL decreaseHide;

/// 边框颜色，默认无颜色，无边框
@property (nonatomic, strong) IBInspectable UIColor *borderColor;

/// 当前数量的字体大小
@property (nonatomic, assign) IBInspectable CGFloat numberFontSize;

/// 当前数量是否支持键盘输入,默认YES
@property (nonatomic, assign) IBInspectable BOOL canInputNumber;

/// 加减按钮的字体大小
@property (nonatomic, assign) IBInspectable CGFloat buttonFontSize;

/// 加按钮背景图片
@property (nonatomic, strong) IBInspectable UIImage *increaseImage;

/// 加按钮文字
@property (nonatomic, copy  ) IBInspectable NSString *increaseTitle;

/// 减按钮背景图片
@property (nonatomic, strong) IBInspectable UIImage *decreaseImage;

/// 减按钮文字
@property (nonatomic, copy  ) IBInspectable NSString *decreaseTitle;

/// 当前数量
@property (nonatomic, copy  ) IBInspectable NSString *currentNumber;

/// 最小值，默认1
@property (nonatomic, assign) IBInspectable NSInteger minValue;

/// 最大值，默认∞
@property (nonatomic, assign) IBInspectable NSInteger maxValue;

@end
